<html>
    <head>
    <link rel="stylesheet" href="lmm.css" type="text/css" />
    </head>
<body class="lmm">
<!-- This file is part of the Lisp Machine manual.	-*-Text-*- -->


<!-- New section on FILES for the manual to explain: -->
<!-- Mention packages and how they relate to files. -->
<!-- BEGF/ENDF sectioning. -->
<!-- File computer file system. -->
<!-- FILE job? -->
<!-- Pointer to file philosophy of EINE. -->
<!-- FILES package. -->

<div class='chapter' id='23'>23. Files</div><p class='cindent'><!-- "file" -->

	This chapter explains how the Lisp Machine system interacts
with files and the file system.  It explains how to keep your
programs in files and how to get them into the Lisp environment,
how they relate to packages, how they are divided into sections,
and how they are seen by EINE (the editor).

	Eventually, Lisp Machines will be able to support
their own file sytems, or use a special purpose "File Computer"
over the Chaosnet.  At the moment, the prototype Lisp Machine
uses the A.I. PDP-10 file system.  To allow it
to access the PDP-10 (which is not yet attached to the Chaosnet),
a special program must be run on the PDP-10, which is invoked
by typing <!-- open: 1, close: 0 --><font class="lisp">:lmio;file</font><!-- open: 1, close: 1 --> <!-- MATCHED MATCHED MATCHED --> to DDT.

	A <!-- open: 2, close: 1 --><font class="italic">pathname</font><!-- open: 2, close: 2 --> <!-- MATCHED MATCHED MATCHED --> or <!-- open: 3, close: 2 --><font class="italic">filename</font><!-- open: 3, close: 3 --> <!-- MATCHED MATCHED MATCHED --> is a string of characters
which identifies a file in the file system.  On the existing file
system, a pathname looks like 

"<!-- open: 4, close: 3 --><font class="italic">device</font><!-- open: 4, close: 4 --> <!-- MATCHED MATCHED MATCHED -->: <!-- open: 5, close: 4 --><font class="italic">directory</font><!-- open: 5, close: 5 --> <!-- MATCHED MATCHED MATCHED -->; <!-- open: 6, close: 5 --><font class="italic">fn1</font><!-- open: 6, close: 6 --> <!-- MATCHED MATCHED MATCHED --> <!-- open: 7, close: 6 --><font class="italic">fn2</font><!-- open: 7, close: 7 --> <!-- MATCHED MATCHED MATCHED -->"

It is assumed that the reader of this document is familiar with the
meanings of these pathnames, and the use of "&gt;" as the <!-- open: 8, close: 7 --><font class="italic">fn2</font><!-- open: 8, close: 8 --> <!-- MATCHED MATCHED MATCHED --> in a
pathname.  Unlike Maclisp, Lisp Machine functions usually take
filenames as a character string, rather then as a list.  Most functions understand pathnames
in which some components are not specified.  For example, in the
string <!-- open: 9, close: 8 --><font class="lisp">"lispm;qmod"</font><!-- open: 9, close: 9 --> <!-- MATCHED MATCHED MATCHED -->, the <!-- open: 10, close: 9 --><font class="italic">device</font><!-- open: 10, close: 10 --> <!-- MATCHED MATCHED MATCHED --> and <!-- open: 11, close: 10 --><font class="italic">fn2</font><!-- open: 11, close: 11 --> <!-- MATCHED MATCHED MATCHED --> are not specified.

<div class='section' id='23.1'>23.1 Functions for Loading Programs</div>
<div class='subsection id='23.1.1''>23.1.1 Functions for Loading Single Files</div>
<div class='defun' id='load'>
  <font class='exdent'>
    <font class='funcname'>load </font>
    <font class='italic' color='purple'>pathname &optional pkg</font>
  </font><br>
This function loads the file <!-- open: 12, close: 11 --><font class="italic">pathname</font><!-- open: 12, close: 12 --> <!-- MATCHED MATCHED MATCHED --> into the Lisp environment.
If the file is a QFASL file, it calls <!-- open: 13, close: 12 --><font class="lisp">fasload</font><!-- open: 13, close: 13 --> <!-- MATCHED MATCHED MATCHED -->; otherwise
it calls <!-- open: 14, close: 13 --><font class="lisp">readfile</font><!-- open: 14, close: 14 --> <!-- MATCHED MATCHED MATCHED -->.  <!-- open: 15, close: 14 --><font class="italic">pkg</font><!-- open: 15, close: 15 --> <!-- MATCHED MATCHED MATCHED --> should be a package or the name of a package, and if
it is given it is used as the current package when the file
is read in.  Usually it is not given; when it is not supplied
explicitly, <!-- open: 16, close: 15 --><font class="lisp">load</font><!-- open: 16, close: 16 --> <!-- MATCHED MATCHED MATCHED --> tries to figure out what package to use
by calling <!-- open: 17, close: 16 --><font class="lisp">pkg-find-file-package</font><!-- open: 17, close: 17 --> <!-- MATCHED MATCHED MATCHED -->.  If the FN2 is not
specified in <!-- open: 18, close: 17 --><font class="italic">pathname</font><!-- open: 18, close: 18 --> <!-- MATCHED MATCHED MATCHED -->, <!-- open: 19, close: 18 --><font class="lisp">load</font><!-- open: 19, close: 19 --> <!-- MATCHED MATCHED MATCHED --> first tries appending
the <!-- open: 20, close: 19 --><font class="italic">fn2</font><!-- open: 20, close: 20 --> <!-- MATCHED MATCHED MATCHED --> <!-- open: 21, close: 20 --><font class="lisp">"qfasl"</font><!-- open: 21, close: 21 --> <!-- MATCHED MATCHED MATCHED -->, and then tries the <!-- open: 22, close: 21 --><font class="italic">fn2</font><!-- open: 22, close: 22 --> <!-- MATCHED MATCHED MATCHED --> <!-- open: 23, close: 22 --><font class="lisp">"&gt;"</font><!-- open: 23, close: 23 --> <!-- MATCHED MATCHED MATCHED -->
if the <!-- open: 24, close: 23 --><font class="lisp">"qfasl"</font><!-- open: 24, close: 24 --> <!-- MATCHED MATCHED MATCHED --> file is not found.
</div>

<div class='defun' id='readfile'>
  <font class='exdent'>
    <font class='funcname'>readfile </font>
    <font class='italic' color='purple'>pathname</font>
  </font><br>
<!-- open: 25, close: 24 --><font class="lisp">readfile</font><!-- open: 25, close: 25 --> <!-- MATCHED MATCHED MATCHED --> sequentially reads and evaluates forms
from the file <!-- open: 26, close: 25 --><font class="italic">pathname</font><!-- open: 26, close: 26 --> <!-- MATCHED MATCHED MATCHED -->, in the current package.
</div>

<div class='defun' id='fasload'>
  <font class='exdent'>
    <font class='funcname'>fasload </font>
    <font class='italic' color='purple'>pathname</font>
  </font><br>
<!-- open: 27, close: 26 --><font class="lisp">fasload</font><!-- open: 27, close: 27 --> <!-- MATCHED MATCHED MATCHED --> reads in and processes a QFASL file,
in the current package.  That is, it defines functions
and performs other actions as directed by the specifications
inserted in the file by the compiler.
</div>

<div class='subsection id='23.1.2''>23.1.2 Loading and Compiling Whole Packages</div>
	Because each package has a file-alist, it is possible to request that
the files of a package be compiled or loaded, as needed.  This is done
with the <!-- open: 28, close: 27 --><font class="lisp">pkg-load</font><!-- open: 28, close: 28 --> <!-- MATCHED MATCHED MATCHED --> function, which takes as arguments a package and a
list of keywords (or one keyword) specifying the precise nature of the
operation.  For example, <!-- open: 29, close: 28 --><font class="lisp">(pkg-load "eine" ':compile)</font><!-- open: 29, close: 29 --> <!-- MATCHED MATCHED MATCHED --> would recompile and
reload the files of the <!-- open: 30, close: 29 --><font class="lisp">eine</font><!-- open: 30, close: 30 --> <!-- MATCHED MATCHED MATCHED --> package, such as require it.

<div class='defun' id='pkg-load'>
  <font class='exdent'>
    <font class='funcname'>pkg-load </font>
    <font class='italic' color='purple'>package &optional keywords</font>
  </font><br>
This function loads and/or compiles the files of a package.  <!-- open: 31, close: 30 --><font class="italic">package</font><!-- open: 31, close: 31 --> <!-- MATCHED MATCHED MATCHED -->
may be a package or a package name; <!-- open: 32, close: 31 --><font class="italic">keywords</font><!-- open: 32, close: 32 --> <!-- MATCHED MATCHED MATCHED --> should be one of the
keyword symbols below or a list of keywords.  The keywords control
what <!-- open: 33, close: 32 --><font class="lisp">pkg-load</font><!-- open: 33, close: 33 --> <!-- MATCHED MATCHED MATCHED --> does.

The keywords defined include:
<table>
<tr valign='top'>
<td><font class='lisp'> :confirm</font></td><td>Ask for confirmation before doing it (this is the default);
</td></tr>
<tr valign='top'>
<td><font class='lisp'> :noconfirm</font></td><td>Don't ask for confirmation
</td></tr>
<tr valign='top'>
<td><font class='lisp'> :compile</font></td><td>Compile files before loading;
</td></tr>
<tr valign='top'>
<td><font class='lisp'> :nocompile</font></td><td>Do not compile (this is the default);
</td></tr>
<tr valign='top'>
<td><font class='lisp'> :load</font></td><td>Load files (the default);
</td></tr>
<tr valign='top'>
<td><font class='lisp'> :noload</font></td><td>Don't load (but compile, if that was specified);
</td></tr>
<tr valign='top'>
<td><font class='lisp'> :selective</font></td><td>Ask about each file;
</td></tr>
<tr valign='top'>
<td><font class='lisp'> :complete</font></td><td>Don't ask about each file (the default);
</td></tr>
<tr valign='top'>
<td><font class='lisp'> :reload</font></td><td>Compile or load even files which appear not to need it;
</td></tr>
<tr valign='top'>
<td><font class='lisp'> :noreload</font></td><td>Only process files which have newer versions on disk (the default);
</td></tr>
<tr valign='top'>
<td><font class='lisp'> :recursive</font></td><td>Also process packages this one refers to;
</td></tr>
<tr valign='top'>
<td><font class='lisp'> :defs</font></td><td>Process only DEFS files.
</td></tr><!-- item_ --></table><!-- end table -->


	See also <!-- open: 34, close: 33 --><font class="lisp">recompile-world</font><!-- open: 34, close: 34 --> <!-- MATCHED MATCHED MATCHED --> (<font color='red'>LINK:(</font>recompile-world-fun)).
</div>
<!-- eof -->
</body>
</html>

